<% if Monologue::Config.twitter_username.present? %>
  <a href="https://twitter.com/share" class="twitter-share-button"
     data-lang="<%= Monologue::Config.twitter_locale || "en" %>"
     data-url="<%= request.protocol %><%= request.host_with_port %><%= request.path.gsub("//", "/") %>"
     data-via="<%= Monologue::Config.twitter_username %>"
     data-text="<%= @post.title %>"
     data-count="horizontal">Tweet</a>

  <script>!function (d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (!d.getElementById(id)) {
      js = d.createElement(s);
      js.id = id;
      js.src = "//platform.twitter.com/widgets.js";
      fjs.parentNode.insertBefore(js, fjs);
    }
  }(document, "script", "twitter-wjs");</script>
<% end %>